package com.ruoyi.whzj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.whzj.mapper.WhExperiencerecordMapper;
import com.ruoyi.whzj.domain.WhExperiencerecord;
import com.ruoyi.whzj.service.IWhExperiencerecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户经验变动记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-21
 */
@Service
public class WhExperiencerecordServiceImpl implements IWhExperiencerecordService 
{
    @Autowired
    private WhExperiencerecordMapper whExperiencerecordMapper;

    /**
     * 查询用户经验变动记录
     * 
     * @param id 用户经验变动记录ID
     * @return 用户经验变动记录
     */
    @Override
    public WhExperiencerecord selectWhExperiencerecordById(String id)
    {
        return whExperiencerecordMapper.selectWhExperiencerecordById(id);
    }

    /**
     * 查询用户经验变动记录列表
     * 
     * @param whExperiencerecord 用户经验变动记录
     * @return 用户经验变动记录
     */
    @Override
    public List<WhExperiencerecord> selectWhExperiencerecordList(WhExperiencerecord whExperiencerecord)
    {
        return whExperiencerecordMapper.selectWhExperiencerecordList(whExperiencerecord);
    }

    /**
     * 新增用户经验变动记录
     * 
     * @param whExperiencerecord 用户经验变动记录
     * @return 结果
     */
    @Override
    public int insertWhExperiencerecord(WhExperiencerecord whExperiencerecord)
    {
       whExperiencerecord.setId(IdWorker.getId());
        whExperiencerecord.setCreateTime(DateUtils.getNowDate());
        return whExperiencerecordMapper.insertWhExperiencerecord(whExperiencerecord);
    }

    /**
     * 修改用户经验变动记录
     * 
     * @param whExperiencerecord 用户经验变动记录
     * @return 结果
     */
    @Override
    public int updateWhExperiencerecord(WhExperiencerecord whExperiencerecord)
    {
        return whExperiencerecordMapper.updateWhExperiencerecord(whExperiencerecord);
    }

    /**
     * 删除用户经验变动记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWhExperiencerecordByIds(String ids)
    {
        return whExperiencerecordMapper.deleteWhExperiencerecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户经验变动记录信息
     * 
     * @param id 用户经验变动记录ID
     * @return 结果
     */
    @Override
    public int deleteWhExperiencerecordById(String id)
    {
        return whExperiencerecordMapper.deleteWhExperiencerecordById(id);
    }
}
